package com.auction.service.impl;

import com.auction.common.dao.MyBaseServiceImpl;
import com.auction.common.dao.bean.PageResult;
import com.auction.entity.TransactionLog;
import com.auction.mapper.TransactionLogMapper;
import com.auction.service.TransactionLogService;
import com.auction.util.TranQuery;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TransactionLogServiceImpl extends MyBaseServiceImpl<TransactionLog, TransactionLogMapper> implements TransactionLogService {
    @Override
    public PageResult<Map> getTraList(TranQuery tranQuery) {

        PageHelper.startPage(tranQuery.getPage(), tranQuery.getPageSize());
        List<Map> list = baseMapper.getTraList(tranQuery);
        PageInfo<Map> pageInfo = new PageInfo<Map>(list);

        return new PageResult<>(tranQuery.getPage(),tranQuery.getPageSize(),pageInfo.getTotal(),list);
    }
}
